<!DOCTYPE html>
<style>
@font-face {
  font-family: CustomFont;
  src: url('../../../resources/Ahem.ttf');
}
span {
  font: 48px CustomFont;
}
</style>
<span id="text"></span>
<script>
document.fonts.load('48px CustomFont').then(() => {
  var span = document.getElementById('text');
  span.innerText = 'Hello';
  window.parent.postMessage(span.offsetWidth, '*');
});
</script>
